package com.caption.api.handler.base;

import com.caption.api.support.ApiSupport;
import com.caption.utils.SpringContextUtil;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;

/**
 * 公共处理类
 */
public abstract class AbstractHandler {

    private ApiSupport apiSupport;

    private String version;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public AbstractHandler(){
        //获取api管理对象
        apiSupport = (ApiSupport) SpringContextUtil.getBean("apiSupport");
    }

    public ApiSupport getApiSupport() {
        return apiSupport;
    }

    public abstract  <T> T call() throws ExecutionException, InterruptedException, TimeoutException;
}
